package com.linewell.service.impl;

import com.linewell.dao.CollectedMapper;
import com.linewell.entity.Collected;
import com.linewell.service.ICollectedService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Title: ssm2
 * @description:
 * @author: hyuhuang@linewell.com
 * @since:2018/2/27
 */
@Service
public class CollectedService implements ICollectedService{

    @Autowired
    private CollectedMapper collectedMapper;

    public List<Collected> getAll() {
        return collectedMapper.getAll();
    }

    public int addCollected(Collected c) {
        return collectedMapper.addCollected(c);
    }

    public int deleteCollected(long collectionId) {
        return collectedMapper.deleteCollected(collectionId);
    }

    public List<Collected> selectFive(long userId) {
        // TODO Auto-generated method stub
        return collectedMapper.selectFive(userId);
    }

    public int getCollectedById(long articleId) {
        // TODO Auto-generated method stub
        return collectedMapper.getCollectedById(articleId);
    }

    public int deleteCollectedByUser(long articleId, long userId) {
        // TODO Auto-generated method stub
        return collectedMapper.deleteCollectedByUser(articleId, userId);
    }

    public int IsCollected(long articleId, long userId) {
        // TODO Auto-generated method stub
        return collectedMapper.IsCollected(articleId, userId);
    }
}
